<?php
/**
*Request entry point.
*@author Willy Gardiol
*@version 1.0
*@package EntryPoints
*/
/**
*/

header("Cache-control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1958 05:05:05 GMT");

$error_reporting_style = "text";

require_once "Engine/engine.php";

# Lets profile out request...
$request_profile = new CoreProfile("Request");

$stuff = false;
# Ensure we have a valid request...
if ( ($request = Core::GetReqId()) === false )
{
	echo "Sorry, the given ID is invalid!";
	die();
}

# yes we do, no try to build it
try { $req_obj = new $request(); }
catch (Exception $e) { # Unable to create a valid request...
	echo "Sorry, either the ID is invalid or something else went wrong!";
	throw $e;
}

# so far, so good... the request has been created properly: do the request processing!
$stuff = $req_obj->DoRequest();

# Stop profiling
$request_profile->Stop();

?>